package com.chixing.ih.module.task.mapper;

import com.chixing.ih.common.IhRepository;
import com.chixing.ih.module.task.mapper.provider.ProgressTaskMapperProvider;
import com.chixing.ih.module.task.pojo.DTO.ProgressTaskDTO;
import com.chixing.ih.module.task.pojo.ProgressTask;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 目的:
 *
 * @author ：zcw
 * @version: 1.0  2020/9/25 23:01
 */
@Mapper
public interface ProgressTaskMapper extends IhRepository<ProgressTask> {
    @SelectProvider(type = ProgressTaskMapperProvider.class, method = "findAll")
    @Results(id = "ProgressTaskMap", value = {
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "order_id", property = "orderId"),
            @Result(column = "submit_content", property = "subTask"),
            @Result(column = "create_time", property = "createTime"),
            @Result(column = "update_time", property = "updateTime"),
            @Result(column = "is_deleted", property = "logicalDeletion")
    })
    List<ProgressTaskDTO> findAll(Long orderId);

    @SelectProvider(type = ProgressTaskMapperProvider.class, method = "findOne")
    @ResultMap({"ProgressTaskMap"})
    ProgressTask findOne(Long ProgressTaskId);


    @InsertProvider(type = ProgressTaskMapperProvider.class, method = "insertOne")
    int insertOne(ProgressTask progressTask);

}
